package com.ruoyi.manger.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.manger.mapper.ResourceDocumentMapper;
import com.ruoyi.manger.domain.ResourceDocument;
import com.ruoyi.manger.service.IResourceDocumentService;

/**
 * 公共资源文档下载Service业务层处理
 * 
 * @author ssh
 * @date 2024-12-15
 */
@Service
public class ResourceDocumentServiceImpl implements IResourceDocumentService 
{
    @Autowired
    private ResourceDocumentMapper resourceDocumentMapper;

    /**
     * 查询公共资源文档下载
     * 
     * @param id 公共资源文档下载主键
     * @return 公共资源文档下载
     */
    @Override
    public ResourceDocument selectResourceDocumentById(Long id)
    {
        return resourceDocumentMapper.selectResourceDocumentById(id);
    }

    /**
     * 查询公共资源文档下载列表
     * 
     * @param resourceDocument 公共资源文档下载
     * @return 公共资源文档下载
     */
    @Override
    public List<ResourceDocument> selectResourceDocumentList(ResourceDocument resourceDocument)
    {
        return resourceDocumentMapper.selectResourceDocumentList(resourceDocument);
    }

    /**
     * 新增公共资源文档下载
     * 
     * @param resourceDocument 公共资源文档下载
     * @return 结果
     */
    @Override
    public int insertResourceDocument(ResourceDocument resourceDocument)
    {
        resourceDocument.setCreateTime(DateUtils.getNowDate());
        return resourceDocumentMapper.insertResourceDocument(resourceDocument);
    }

    /**
     * 修改公共资源文档下载
     * 
     * @param resourceDocument 公共资源文档下载
     * @return 结果
     */
    @Override
    public int updateResourceDocument(ResourceDocument resourceDocument)
    {
        resourceDocument.setUpdateTime(DateUtils.getNowDate());
        return resourceDocumentMapper.updateResourceDocument(resourceDocument);
    }

    /**
     * 批量删除公共资源文档下载
     * 
     * @param ids 需要删除的公共资源文档下载主键
     * @return 结果
     */
    @Override
    public int deleteResourceDocumentByIds(Long[] ids)
    {
        return resourceDocumentMapper.deleteResourceDocumentByIds(ids);
    }

    /**
     * 删除公共资源文档下载信息
     * 
     * @param id 公共资源文档下载主键
     * @return 结果
     */
    @Override
    public int deleteResourceDocumentById(Long id)
    {
        return resourceDocumentMapper.deleteResourceDocumentById(id);
    }
}
